From daf8653e27160ff71bc44bc453a46adfb53737c4 Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Thu, 28 Apr 2005 22:24:03 +0000 Subject: [PATCH] bitkeeper revision 1.1327.1.11 (42716283nLvDhTYM3QOqDMa-wZuJHQ) More code cleanup --- .rootkeys | 12 +- xen/arch/ia64/Makefile | 2 +- xen/arch/ia64/patch/linux-2.6.11/current.h | 22 -- xen/arch/ia64/patch/linux-2.6.11/hardirq.h | 15 -- xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c | 41 ---- xen/arch/ia64/patch/linux-2.6.11/irq.h | 23 -- .../ia64/patch/linux-2.6.11/kernel-time.c | 44 ---- .../ia64/patch/linux-2.6.11/linuxextable.c | 16 -- xen/arch/ia64/patch/linux-2.6.11/linuxtime.h | 36 --- xen/arch/ia64/patch/linux-2.6.11/mm_contig.c | 231 +++--------------- xen/arch/ia64/patch/linux-2.6.11/mmzone.h | 19 -- xen/arch/ia64/patch/linux-2.6.11/sal.h | 39 --- xen/arch/ia64/patch/linux-2.6.11/slab.h | 19 -- xen/arch/ia64/patch/linux-2.6.11/unaligned.c | 86 +------ xen/arch/ia64/patch/linux-2.6.11/wait.h | 35 --- xen/arch/ia64/tools/mkbuildtree | 6 +- xen/arch/ia64/xenmem.c | 67 +++++ xen/arch/ia64/xenmisc.c | 34 +++ 18 files changed, 149 insertions(+), 598 deletions(-) delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/current.h delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/hardirq.h delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/irq.h delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/kernel-time.c delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/linuxextable.c delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/linuxtime.h delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/mmzone.h delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/sal.h delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/slab.h delete mode 100644 xen/arch/ia64/patch/linux-2.6.11/wait.h create mode 100644 xen/arch/ia64/xenmem.c diff --git a/.rootkeys b/.rootkeys index c463985a86..a4177c1adc 100644 --- a/.rootkeys +++ b/.rootkeys @@ -1082,43 +1082,32 @@ 421098b3O0MYMUsmYVFy84VV_1gFwQ xen/arch/ia64/mm_init.c 425ae516skiHBZU-Kfwxv2YWXfNRWQ xen/arch/ia64/patch/linux-2.6.11/bootmem.h 425ae516maKAsHBJVSzs19cdRgt3Nw xen/arch/ia64/patch/linux-2.6.11/cpumask.h -425ae516rHybgKj6KsvBOE0c_Hruxg xen/arch/ia64/patch/linux-2.6.11/current.h 425ae516cGqvMzGtihTEsQXAXsuOhQ xen/arch/ia64/patch/linux-2.6.11/efi.c 425ae516Y1A4q4_Kfre3qnDj7lbHJg xen/arch/ia64/patch/linux-2.6.11/entry.S -425ae516RoFheL-Ua-EOtFqmLxoc9g xen/arch/ia64/patch/linux-2.6.11/hardirq.h 425ae516PDO1ESDHXHVeDNvlqUfmdQ xen/arch/ia64/patch/linux-2.6.11/head.S -425ae5163aiWdc1IZNsON6ruE2-n9g xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c 425ae516JR7HWvt1zxJ-wLvEWmJGgg xen/arch/ia64/patch/linux-2.6.11/hpsim_ssc.h 425ae516AHRNmaVuZjJY-9YjmKRDqg xen/arch/ia64/patch/linux-2.6.11/interrupt.h 425ae516U2wFUzrUJQUpy3z38jZHsQ xen/arch/ia64/patch/linux-2.6.11/io.h -425ae516nXL2iTzpziIaSLi3N257qQ xen/arch/ia64/patch/linux-2.6.11/irq.h 425ae516GGRmXijPBLC5ii6yWOn0rg xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c 425ae516qQA5dHuIybqfN3nEzM_Zvg xen/arch/ia64/patch/linux-2.6.11/ivt.S -425ae516_UhrTa3Y8wDG7fTgX6pNYA xen/arch/ia64/patch/linux-2.6.11/kernel-time.c 425ae516atiECmpn_6nZDw4kkmbJ6g xen/arch/ia64/patch/linux-2.6.11/kregs.h 425ae516lwlYwHG1Jv93kC3tfU5caw xen/arch/ia64/patch/linux-2.6.11/lds.S -425ae516UGTH2xC56DEIlHSrPH4oxg xen/arch/ia64/patch/linux-2.6.11/linuxextable.c 425ae516txAP-owjzpTJ7ThfzWR8nw xen/arch/ia64/patch/linux-2.6.11/linuxhardirq.h -425ae516kNsO5yYnBHvAISdvCkQ2-g xen/arch/ia64/patch/linux-2.6.11/linuxtime.h 425ae516Je2zI-Iw30_uGhvUYdlCZQ xen/arch/ia64/patch/linux-2.6.11/mca_asm.h 425ae5160-9wHxh0tOnIjavEjt6W0A xen/arch/ia64/patch/linux-2.6.11/minstate.h 425ae516N7SaORdbodDr90tmtCzYXw xen/arch/ia64/patch/linux-2.6.11/mm_contig.c -425ae516YcBgoZ3xCTEmhCrgX8CjCA xen/arch/ia64/patch/linux-2.6.11/mmzone.h 425ae516WDLrfEA4zr40d00z0VIWPg xen/arch/ia64/patch/linux-2.6.11/page.h 425ae516pVQ75NhdItT593SiWI0lbQ xen/arch/ia64/patch/linux-2.6.11/pal.S 425ae516QfmjiF_a-mabAXqV8Imzkg xen/arch/ia64/patch/linux-2.6.11/pgalloc.h 425ae516EWaNOBEnc1xnphTbRmNZsw xen/arch/ia64/patch/linux-2.6.11/processor.h -425ae5165sks4NwRldZOV_p63fspYw xen/arch/ia64/patch/linux-2.6.11/sal.h 425ae516LecDyXlwh3NLBtHZKXmMcA xen/arch/ia64/patch/linux-2.6.11/series 425ae516RFiPn2CGkpJ21LM-1lJcQg xen/arch/ia64/patch/linux-2.6.11/setup.c -425ae516-xgihgqPEv-Aq8-9cNoCXg xen/arch/ia64/patch/linux-2.6.11/slab.h 425ae516FX_10YaKGMU8Ysf7kkdm_A xen/arch/ia64/patch/linux-2.6.11/swiotlb.c 425ae516p4ICTkjqNYEfYFxqULj4dw xen/arch/ia64/patch/linux-2.6.11/system.h 425ae516juUB257qrwUdsL9AsswrqQ xen/arch/ia64/patch/linux-2.6.11/time.c 425ae5167zQn7zYcgKtDUDX2v-e8mw xen/arch/ia64/patch/linux-2.6.11/tlb.c 425ae5162bIl2Dgd19x-FceB4L9oGw xen/arch/ia64/patch/linux-2.6.11/types.h 425ae516cFUNY2jHD46bujcF5NJheA xen/arch/ia64/patch/linux-2.6.11/unaligned.c -425ae516viTtlyQjWHf6kBmq8KcwiQ xen/arch/ia64/patch/linux-2.6.11/wait.h 421098b39QFMC-1t1r38CA7NxAYBPA xen/arch/ia64/patch/linux-2.6.7/bootmem.h 421098b3SIA1vZX9fFUjo1T3o_jMCQ xen/arch/ia64/patch/linux-2.6.7/current.h 421098b3ZBl80iPuSeDU_Id5AgZl0w xen/arch/ia64/patch/linux-2.6.7/efi.c @@ -1179,6 +1168,7 @@ 41a26ebc--sjlYZQxmIxyCx3jw70qA xen/arch/ia64/vcpu.c 421098b6M2WhsJ_ZMzFamAQcdc5gzw xen/arch/ia64/vhpt.c 41a26ebc4jSBGQOuyNIPDST58mNbBw xen/arch/ia64/xenasm.S +427162263zDUiPmTj-lP4eGyXs5eIg xen/arch/ia64/xenmem.c 421098b6mWyFPtkhPz9h1LCmKpoCLg xen/arch/ia64/xenmisc.c 421098b6lY2JzrV1oFDbrt7XQhtElg xen/arch/ia64/xensetup.c 3ddb79bcZbRBzT3elFWSX7u6NtMagQ xen/arch/x86/Makefile diff --git a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile index 6bc52ee152..cde36319dc 100644 --- a/xen/arch/ia64/Makefile +++ b/xen/arch/ia64/Makefile @@ -6,7 +6,7 @@ OBJS = xensetup.o setup.o time.o irq.o ia64_ksyms.o process.o smp.o \ xenmisc.o pdb-stub.o acpi.o hypercall.o \ machvec.o dom0_ops.o domain.o \ idle0_task.o pal.o hpsim.o efi.o efi_stub.o ivt.o mm_contig.o \ - sal.o cmdline.o mm_init.o tlb.o smpboot.o \ + xenmem.o sal.o cmdline.o mm_init.o tlb.o smpboot.o \ extable.o linuxextable.o \ regionreg.o entry.o unaligned.o privop.o vcpu.o \ irq_ia64.o irq_lsapic.o vhpt.o xenasm.o dom_fw.o diff --git a/xen/arch/ia64/patch/linux-2.6.11/current.h b/xen/arch/ia64/patch/linux-2.6.11/current.h deleted file mode 100644 index 195270ac0d..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/current.h +++ /dev/null @@ -1,22 +0,0 @@ - current.h | 8 ++++++++ - 1 files changed, 8 insertions(+) - -Index: linux-2.6.11/include/asm-ia64/current.h -=================================================================== ---- linux-2.6.11.orig/include/asm-ia64/current.h 2005-03-02 01:38:19.000000000 -0600 -+++ linux-2.6.11/include/asm-ia64/current.h 2005-03-19 12:39:41.410955288 -0600 -@@ -12,6 +12,14 @@ - * In kernel mode, thread pointer (r13) is used to point to the current task - * structure. - */ -+#ifdef XEN -+struct domain; -+#define get_current() ((struct exec_domain *) ia64_getreg(_IA64_REG_TP)) -+#define current get_current() -+//#define set_current(d) ia64_setreg(_IA64_REG_TP,(void *)d); -+#define set_current(d) (ia64_r13 = (void *)d) -+#else - #define current ((struct task_struct *) ia64_getreg(_IA64_REG_TP)) -+#endif - - #endif /* _ASM_IA64_CURRENT_H */ diff --git a/xen/arch/ia64/patch/linux-2.6.11/hardirq.h b/xen/arch/ia64/patch/linux-2.6.11/hardirq.h deleted file mode 100644 index 52077f2da8..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/hardirq.h +++ /dev/null @@ -1,15 +0,0 @@ - hardirq.h | 1 + - 1 files changed, 1 insertion(+) - -Index: linux-2.6.11-xendiffs/include/asm-ia64/hardirq.h -=================================================================== ---- linux-2.6.11-xendiffs.orig/include/asm-ia64/hardirq.h 2005-03-24 15:59:37.210502749 -0600 -+++ linux-2.6.11-xendiffs/include/asm-ia64/hardirq.h 2005-03-24 16:00:19.439540961 -0600 -@@ -20,6 +20,7 @@ - #define __ARCH_IRQ_STAT 1 - - #define local_softirq_pending() (local_cpu_data->softirq_pending) -+#define softirq_pending(cpu) (cpu_data(cpu)->softirq_pending) - - #define HARDIRQ_BITS 14 - diff --git a/xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c b/xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c deleted file mode 100644 index a212275865..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c +++ /dev/null @@ -1,41 +0,0 @@ - hpsim_irq.c | 15 +++++++++++++++ - 1 files changed, 15 insertions(+) - -Index: linux-2.6.11/arch/ia64/hp/sim/hpsim_irq.c -=================================================================== ---- linux-2.6.11.orig/arch/ia64/hp/sim/hpsim_irq.c 2005-03-02 01:38:33.000000000 -0600 -+++ linux-2.6.11/arch/ia64/hp/sim/hpsim_irq.c 2005-03-19 13:33:57.312014806 -0600 -@@ -9,7 +9,17 @@ - #include - #include - #include -+#ifdef XEN -+#include -+#endif - -+#if 1 -+void __init -+hpsim_irq_init (void) -+{ -+ printf("*** hpsim_irq_init called: NOT NEEDED?!?!?\n"); -+} -+#else - static unsigned int - hpsim_irq_startup (unsigned int irq) - { -@@ -19,6 +29,10 @@ hpsim_irq_startup (unsigned int irq) - static void - hpsim_irq_noop (unsigned int irq) - { -+#if 1 -+printf("hpsim_irq_noop: irq=%d\n",irq); -+while(irq); -+#endif - } - - static void -@@ -49,3 +63,4 @@ hpsim_irq_init (void) - idesc->handler = &irq_type_hp_sim; - } - } -+#endif diff --git a/xen/arch/ia64/patch/linux-2.6.11/irq.h b/xen/arch/ia64/patch/linux-2.6.11/irq.h deleted file mode 100644 index d4937de5db..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/irq.h +++ /dev/null @@ -1,23 +0,0 @@ - irq.h | 9 +++++++++ - 1 files changed, 9 insertions(+) - -Index: linux-2.6.11/include/asm-ia64/irq.h -=================================================================== ---- linux-2.6.11.orig/include/asm-ia64/irq.h 2005-03-02 01:38:33.000000000 -0600 -+++ linux-2.6.11/include/asm-ia64/irq.h 2005-03-19 13:42:27.957677364 -0600 -@@ -30,6 +30,15 @@ extern void disable_irq_nosync (unsigned - extern void enable_irq (unsigned int); - extern void set_irq_affinity_info (unsigned int irq, int dest, int redir); - -+#ifdef XEN -+// dup'ed from signal.h to avoid changes to includes -+#define SA_NOPROFILE 0x02000000 -+#define SA_SHIRQ 0x04000000 -+#define SA_RESTART 0x10000000 -+#define SA_INTERRUPT 0x20000000 -+#define SA_SAMPLE_RANDOM SA_RESTART -+#endif -+ - #ifdef CONFIG_SMP - extern void move_irq(int irq); - #else diff --git a/xen/arch/ia64/patch/linux-2.6.11/kernel-time.c b/xen/arch/ia64/patch/linux-2.6.11/kernel-time.c deleted file mode 100644 index 29ff92ee9b..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/kernel-time.c +++ /dev/null @@ -1,44 +0,0 @@ - time.c | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletion(-) - -Index: linux-2.6.11/kernel/time.c -=================================================================== ---- linux-2.6.11.orig/kernel/time.c 2005-03-02 01:37:50.000000000 -0600 -+++ linux-2.6.11/kernel/time.c 2005-03-19 14:56:40.767870674 -0600 -@@ -495,6 +495,7 @@ void getnstimeofday (struct timespec *tv - tv->tv_nsec = nsec; - } - -+#ifndef XEN - int do_settimeofday (struct timespec *tv) - { - time_t wtm_sec, sec = tv->tv_sec; -@@ -503,7 +504,9 @@ int do_settimeofday (struct timespec *tv - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) - return -EINVAL; - -+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN - write_seqlock_irq(&xtime_lock); -+#endif - { - /* - * This is revolting. We need to set "xtime" correctly. However, the value -@@ -525,7 +528,9 @@ int do_settimeofday (struct timespec *tv - time_esterror = NTP_PHASE_LIMIT; - time_interpolator_reset(); - } -+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN - write_sequnlock_irq(&xtime_lock); -+#endif - clock_was_set(); - return 0; - } -@@ -552,7 +557,7 @@ void do_gettimeofday (struct timeval *tv - } - - EXPORT_SYMBOL(do_gettimeofday); -- -+#endif - - #else - /* diff --git a/xen/arch/ia64/patch/linux-2.6.11/linuxextable.c b/xen/arch/ia64/patch/linux-2.6.11/linuxextable.c deleted file mode 100644 index fe796a1476..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/linuxextable.c +++ /dev/null @@ -1,16 +0,0 @@ - extable.c | 2 ++ - 1 files changed, 2 insertions(+) - -Index: linux-2.6.11-xendiffs/kernel/extable.c -=================================================================== ---- linux-2.6.11-xendiffs.orig/kernel/extable.c 2005-03-02 01:37:54.000000000 -0600 -+++ linux-2.6.11-xendiffs/kernel/extable.c 2005-04-08 14:30:46.283360881 -0500 -@@ -20,6 +20,8 @@ - #include - #include - -+#define __module_text_address(addr) (NULL) -+ - extern struct exception_table_entry __start___ex_table[]; - extern struct exception_table_entry __stop___ex_table[]; - diff --git a/xen/arch/ia64/patch/linux-2.6.11/linuxtime.h b/xen/arch/ia64/patch/linux-2.6.11/linuxtime.h deleted file mode 100644 index 4d5b1ed9fc..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/linuxtime.h +++ /dev/null @@ -1,36 +0,0 @@ - time.h | 9 +++++++++ - 1 files changed, 9 insertions(+) - -Index: linux-2.6.11/include/linux/time.h -=================================================================== ---- linux-2.6.11.orig/include/linux/time.h 2005-03-02 01:38:12.000000000 -0600 -+++ linux-2.6.11/include/linux/time.h 2005-03-19 13:46:27.987225234 -0600 -@@ -1,11 +1,18 @@ - #ifndef _LINUX_TIME_H - #define _LINUX_TIME_H - -+#ifdef XEN -+typedef s64 time_t; -+typedef s64 suseconds_t; -+#endif -+ - #include - -+#ifndef XEN - #ifdef __KERNEL__ - #include - #endif -+#endif - - #ifndef _STRUCT_TIMESPEC - #define _STRUCT_TIMESPEC -@@ -80,7 +87,9 @@ mktime (unsigned int year, unsigned int - - extern struct timespec xtime; - extern struct timespec wall_to_monotonic; -+#ifndef XEN - extern seqlock_t xtime_lock; -+#endif - - static inline unsigned long get_seconds(void) - { diff --git a/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c b/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c index 3819120008..df5eb199a6 100644 --- a/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c +++ b/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c @@ -1,220 +1,47 @@ - contig.c | 172 +++++++++++++++++---------------------------------------------- - 1 files changed, 48 insertions(+), 124 deletions(-) - -Index: linux-2.6.11-xendiffs/arch/ia64/mm/contig.c -=================================================================== ---- linux-2.6.11-xendiffs.orig/arch/ia64/mm/contig.c 2005-04-07 11:02:50.227598140 -0500 -+++ linux-2.6.11-xendiffs/arch/ia64/mm/contig.c 2005-04-07 11:05:21.724931959 -0500 -@@ -15,11 +15,21 @@ - * memory. +--- ../../linux-2.6.11/arch/ia64/mm/contig.c 2005-03-02 00:37:55.000000000 -0700 ++++ arch/ia64/mm_contig.c 2005-04-28 16:13:52.000000000 -0600 +@@ -35,6 +35,7 @@ + * + * Just walks the pages in the system and describes where they're allocated. */ - #include -+#ifdef XEN -+#include -+#endif - #include - #include - #include - #include - -+#ifdef XEN -+#undef reserve_bootmem -+extern struct page *zero_page_memmap_ptr; -+struct page *mem_map; -+#define MAX_DMA_ADDRESS ~0UL // FIXME??? -+#endif -+ - #include - #include - #include -@@ -38,30 +48,7 @@ static unsigned long num_dma_physpages; ++#ifndef XEN void show_mem (void) { -- int i, total = 0, reserved = 0; -- int shared = 0, cached = 0; -- -- printk("Mem-info:\n"); -- show_free_areas(); -- -- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); -- i = max_mapnr; -- while (i-- > 0) { -- if (!pfn_valid(i)) -- continue; -- total++; -- if (PageReserved(mem_map+i)) -- reserved++; -- else if (PageSwapCache(mem_map+i)) -- cached++; -- else if (page_count(mem_map + i)) -- shared += page_count(mem_map + i) - 1; -- } -- printk("%d pages of RAM\n", total); -- printk("%d reserved pages\n", reserved); -- printk("%d pages shared\n", shared); -- printk("%d pages swap cached\n", cached); -- printk("%ld pages in page table cache\n", pgtable_cache_size); -+ printk("Dummy show_mem\n"); +@@ -63,6 +64,7 @@ + printk("%d pages swap cached\n", cached); + printk("%ld pages in page table cache\n", pgtable_cache_size); } ++#endif /* physical address where the bootmem map is located */ -@@ -81,6 +68,9 @@ find_max_pfn (unsigned long start, unsig + unsigned long bootmap_start; +@@ -140,6 +142,7 @@ + * Walk the EFI memory map and find usable memory for the system, taking + * into account reserved areas. + */ ++#ifndef XEN + void + find_memory (void) { - unsigned long *max_pfnp = arg, pfn; +@@ -168,6 +171,7 @@ -+#ifdef XEN -+//printf("find_max_pfn: start=%lx, end=%lx, *arg=%lx\n",start,end,*(unsigned long *)arg); -+#endif - pfn = (PAGE_ALIGN(end - 1) - PAGE_OFFSET) >> PAGE_SHIFT; - if (pfn > *max_pfnp) - *max_pfnp = pfn; -@@ -134,41 +124,6 @@ find_bootmap_location (unsigned long sta - return 0; + find_initrd(); } ++#endif --/** -- * find_memory - setup memory map -- * -- * Walk the EFI memory map and find usable memory for the system, taking -- * into account reserved areas. -- */ --void --find_memory (void) --{ -- unsigned long bootmap_size; -- -- reserve_memory(); -- -- /* first find highest page frame number */ -- max_pfn = 0; -- efi_memmap_walk(find_max_pfn, &max_pfn); -- -- /* how many bytes to cover all the pages */ -- bootmap_size = bootmem_bootmap_pages(max_pfn) << PAGE_SHIFT; -- -- /* look for a location to hold the bootmap */ -- bootmap_start = ~0UL; -- efi_memmap_walk(find_bootmap_location, &bootmap_size); -- if (bootmap_start == ~0UL) -- panic("Cannot find %ld bytes for bootmap\n", bootmap_size); -- -- bootmap_size = init_bootmem(bootmap_start >> PAGE_SHIFT, max_pfn); -- -- /* Free all available memory, then mark bootmem-map as being in use. */ -- efi_memmap_walk(filter_rsvd_memory, free_bootmem); -- reserve_bootmem(bootmap_start, bootmap_size); -- -- find_initrd(); --} -- #ifdef CONFIG_SMP /** - * per_cpu_init - setup per-cpu variables -@@ -228,72 +183,41 @@ count_dma_pages (u64 start, u64 end, voi +@@ -225,6 +229,7 @@ + * Set up the page tables. + */ + ++#ifndef XEN void paging_init (void) { -- unsigned long max_dma; -- unsigned long zones_size[MAX_NR_ZONES]; --#ifdef CONFIG_VIRTUAL_MEM_MAP -- unsigned long zholes_size[MAX_NR_ZONES]; -- unsigned long max_gap; --#endif -- -- /* initialize mem_map[] */ -- -- memset(zones_size, 0, sizeof(zones_size)); -- -- num_physpages = 0; -- efi_memmap_walk(count_pages, &num_physpages); -- -- max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; -- --#ifdef CONFIG_VIRTUAL_MEM_MAP -- memset(zholes_size, 0, sizeof(zholes_size)); -+ struct pfn_info *pg; -+ /* Allocate and map the machine-to-phys table */ -+ if ((pg = alloc_domheap_pages(NULL, 10)) == NULL) -+ panic("Not enough memory to bootstrap Xen.\n"); -+ memset(page_to_virt(pg), 0x55, 16UL << 20); - -- num_dma_physpages = 0; -- efi_memmap_walk(count_dma_pages, &num_dma_physpages); -+ /* Other mapping setup */ - -- if (max_low_pfn < max_dma) { -- zones_size[ZONE_DMA] = max_low_pfn; -- zholes_size[ZONE_DMA] = max_low_pfn - num_dma_physpages; -- } else { -- zones_size[ZONE_DMA] = max_dma; -- zholes_size[ZONE_DMA] = max_dma - num_dma_physpages; -- if (num_physpages > num_dma_physpages) { -- zones_size[ZONE_NORMAL] = max_low_pfn - max_dma; -- zholes_size[ZONE_NORMAL] = -- ((max_low_pfn - max_dma) - -- (num_physpages - num_dma_physpages)); -- } -- } -- -- max_gap = 0; -- efi_memmap_walk(find_largest_hole, (u64 *)&max_gap); -- if (max_gap < LARGE_GAP) { -- vmem_map = (struct page *) 0; -- free_area_init_node(0, &contig_page_data, zones_size, 0, -- zholes_size); -- } else { -- unsigned long map_size; -- -- /* allocate virtual_mem_map */ -- -- map_size = PAGE_ALIGN(max_low_pfn * sizeof(struct page)); -- vmalloc_end -= map_size; -- vmem_map = (struct page *) vmalloc_end; -- efi_memmap_walk(create_mem_map_page_table, NULL); -- -- mem_map = contig_page_data.node_mem_map = vmem_map; -- free_area_init_node(0, &contig_page_data, zones_size, -- 0, zholes_size); -- -- printk("Virtual mem_map starts at 0x%p\n", mem_map); -- } --#else /* !CONFIG_VIRTUAL_MEM_MAP */ -- if (max_low_pfn < max_dma) -- zones_size[ZONE_DMA] = max_low_pfn; -- else { -- zones_size[ZONE_DMA] = max_dma; -- zones_size[ZONE_NORMAL] = max_low_pfn - max_dma; -- } -- free_area_init(zones_size); --#endif /* !CONFIG_VIRTUAL_MEM_MAP */ +@@ -297,3 +302,4 @@ + #endif /* !CONFIG_VIRTUAL_MEM_MAP */ zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); } -+ -+struct pfn_info *frame_table; -+unsigned long frame_table_size; -+unsigned long max_page; -+ -+/* FIXME: postpone support to machines with big holes between physical memorys. -+ * Current hack allows only efi memdesc upto 4G place. (See efi.c) -+ */ -+#ifndef CONFIG_VIRTUAL_MEM_MAP -+#define FT_ALIGN_SIZE (16UL << 20) -+void __init init_frametable(void) -+{ -+ unsigned long i, p; -+ frame_table_size = max_page * sizeof(struct pfn_info); -+ frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK; -+ -+ /* Request continuous trunk from boot allocator, since HV -+ * address is identity mapped */ -+ p = alloc_boot_pages(frame_table_size, FT_ALIGN_SIZE); -+ if (p == 0) -+ panic("Not enough memory for frame table.\n"); -+ -+ frame_table = __va(p); -+ memset(frame_table, 0, frame_table_size); -+ printk("size of frame_table: %lukB\n", -+ frame_table_size >> 10); -+} -+#endif ++#endif /* !CONFIG_XEN */ diff --git a/xen/arch/ia64/patch/linux-2.6.11/mmzone.h b/xen/arch/ia64/patch/linux-2.6.11/mmzone.h deleted file mode 100644 index d1c61b4a4e..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/mmzone.h +++ /dev/null @@ -1,19 +0,0 @@ - mmzone.h | 4 ++++ - 1 files changed, 4 insertions(+) - -Index: linux-2.6.11/include/linux/mmzone.h -=================================================================== ---- linux-2.6.11.orig/include/linux/mmzone.h 2005-03-02 01:38:10.000000000 -0600 -+++ linux-2.6.11/include/linux/mmzone.h 2005-03-19 13:49:30.427573139 -0600 -@@ -209,7 +209,11 @@ struct zone { - * rarely used fields: - */ - char *name; -+#ifdef XEN -+}; -+#else - } ____cacheline_maxaligned_in_smp; -+#endif - - - /* diff --git a/xen/arch/ia64/patch/linux-2.6.11/sal.h b/xen/arch/ia64/patch/linux-2.6.11/sal.h deleted file mode 100644 index e600d3c7af..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/sal.h +++ /dev/null @@ -1,39 +0,0 @@ - sal.h | 17 +++++++++++++++++ - 1 files changed, 17 insertions(+) - -Index: linux-2.6.11-xendiffs/include/asm-ia64/sal.h -=================================================================== ---- linux-2.6.11-xendiffs.orig/include/asm-ia64/sal.h 2005-04-08 12:00:53.510988510 -0500 -+++ linux-2.6.11-xendiffs/include/asm-ia64/sal.h 2005-04-08 12:02:17.778587216 -0500 -@@ -36,6 +36,7 @@ - #ifndef __ASSEMBLY__ - - #include -+#include - #include - #include - -@@ -650,7 +651,23 @@ ia64_sal_freq_base (unsigned long which, - { - struct ia64_sal_retval isrv; - -+//#ifdef XEN -+#if 0 -+ unsigned long *x = (unsigned long *)ia64_sal; -+ unsigned long *inst = (unsigned long *)*x; -+ unsigned long __ia64_sc_flags; -+ struct ia64_fpreg __ia64_sc_fr[6]; -+printf("ia64_sal_freq_base: about to save_scratch_fpregs\n"); -+ ia64_save_scratch_fpregs(__ia64_sc_fr); -+ spin_lock_irqsave(&sal_lock, __ia64_sc_flags); -+printf("ia64_sal_freq_base: about to call, ia64_sal=%p, ia64_sal[0]=%p, ia64_sal[1]=%p\n",x,x[0],x[1]); -+printf("first inst=%p,%p\n",inst[0],inst[1]); -+ isrv = (*ia64_sal)(SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0); -+ spin_unlock_irqrestore(&sal_lock, __ia64_sc_flags); -+ ia64_load_scratch_fpregs(__ia64_sc_fr); -+#else - SAL_CALL(isrv, SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0); -+#endif - *ticks_per_second = isrv.v0; - *drift_info = isrv.v1; - return isrv.status; diff --git a/xen/arch/ia64/patch/linux-2.6.11/slab.h b/xen/arch/ia64/patch/linux-2.6.11/slab.h deleted file mode 100644 index e1dda60e15..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/slab.h +++ /dev/null @@ -1,19 +0,0 @@ - slab.h | 4 ++++ - 1 files changed, 4 insertions(+) - -Index: linux-2.6.11/include/linux/slab.h -=================================================================== ---- linux-2.6.11.orig/include/linux/slab.h 2005-03-02 01:38:33.000000000 -0600 -+++ linux-2.6.11/include/linux/slab.h 2005-03-19 14:35:19.301871922 -0600 -@@ -91,7 +91,11 @@ static inline void *kmalloc(size_t size, - goto found; \ - else \ - i++; -+#ifdef XEN -+#include -+#else - #include "kmalloc_sizes.h" -+#endif - #undef CACHE - { - extern void __you_cannot_kmalloc_that_much(void); diff --git a/xen/arch/ia64/patch/linux-2.6.11/unaligned.c b/xen/arch/ia64/patch/linux-2.6.11/unaligned.c index 6bf27842bf..bcc165e95e 100644 --- a/xen/arch/ia64/patch/linux-2.6.11/unaligned.c +++ b/xen/arch/ia64/patch/linux-2.6.11/unaligned.c @@ -1,39 +1,6 @@ - unaligned.c | 27 +++++++++++++++++++++++++++ - 1 files changed, 27 insertions(+) - -Index: linux-2.6.11/arch/ia64/kernel/unaligned.c -=================================================================== ---- linux-2.6.11.orig/arch/ia64/kernel/unaligned.c 2005-03-02 01:38:25.000000000 -0600 -+++ linux-2.6.11/arch/ia64/kernel/unaligned.c 2005-03-19 14:58:51.269335202 -0600 -@@ -15,8 +15,10 @@ - */ - #include - #include -+#ifndef XEN - #include - #include -+#endif - - #include - #include -@@ -24,7 +26,16 @@ - #include - #include - -+#ifdef XEN -+#define ia64_peek(x...) printk("ia64_peek: called, not implemented\n") -+#define ia64_poke(x...) printk("ia64_poke: called, not implemented\n") -+#define ia64_sync_fph(x...) printk("ia64_sync_fph: called, not implemented\n") -+#define ia64_flush_fph(x...) printk("ia64_flush_fph: called, not implemented\n") -+#define die_if_kernel(x...) printk("die_if_kernel: called, not implemented\n") -+#define jiffies 0 -+#else - extern void die_if_kernel(char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn)); -+#endif - - #undef DEBUG_UNALIGNED_TRAP - -@@ -437,7 +448,11 @@ get_rse_reg (struct pt_regs *regs, unsig +--- ../../linux-2.6.11/arch/ia64/kernel/unaligned.c 2005-03-02 00:38:25.000000000 -0700 ++++ arch/ia64/unaligned.c 2005-04-28 15:40:13.000000000 -0600 +@@ -437,7 +437,11 @@ } @@ -45,7 +12,7 @@ Index: linux-2.6.11/arch/ia64/kernel/unaligned.c setreg (unsigned long regnum, unsigned long val, int nat, struct pt_regs *regs) { struct switch_stack *sw = (struct switch_stack *) regs - 1; -@@ -611,7 +626,11 @@ getfpreg (unsigned long regnum, struct i +@@ -611,7 +615,11 @@ } @@ -57,46 +24,19 @@ Index: linux-2.6.11/arch/ia64/kernel/unaligned.c getreg (unsigned long regnum, unsigned long *val, int *nat, struct pt_regs *regs) { struct switch_stack *sw = (struct switch_stack *) regs - 1; -@@ -1298,7 +1317,9 @@ ia64_handle_unaligned (unsigned long ifa - mm_segment_t old_fs = get_fs(); - unsigned long bundle[2]; - unsigned long opcode; -+#ifndef XEN - struct siginfo si; -+#endif - const struct exception_table_entry *eh = NULL; - union { - unsigned long l; -@@ -1317,6 +1338,9 @@ ia64_handle_unaligned (unsigned long ifa - * user-level unaligned accesses. Otherwise, a clever program could trick this - * handler into reading an arbitrary kernel addresses... - */ +@@ -1294,6 +1302,9 @@ + void + ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) + { +#ifdef XEN +printk("ia64_handle_unaligned: called, not working yet\n"); +#else - if (!user_mode(regs)) - eh = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri); - if (user_mode(regs) || eh) { -@@ -1353,6 +1377,7 @@ ia64_handle_unaligned (unsigned long ifa - - if (__copy_from_user(bundle, (void __user *) regs->cr_iip, 16)) - goto failure; -+#endif - - /* - * extract the instruction from the bundle given the slot number -@@ -1493,6 +1518,7 @@ ia64_handle_unaligned (unsigned long ifa - /* NOT_REACHED */ - } - force_sigbus: -+#ifndef XEN - si.si_signo = SIGBUS; - si.si_errno = 0; - si.si_code = BUS_ADRALN; -@@ -1501,5 +1527,6 @@ ia64_handle_unaligned (unsigned long ifa - si.si_isr = 0; + struct ia64_psr *ipsr = ia64_psr(regs); + mm_segment_t old_fs = get_fs(); + unsigned long bundle[2]; +@@ -1502,4 +1513,5 @@ si.si_imm = 0; force_sig_info(SIGBUS, &si, current); -+#endif goto done; ++#endif } diff --git a/xen/arch/ia64/patch/linux-2.6.11/wait.h b/xen/arch/ia64/patch/linux-2.6.11/wait.h deleted file mode 100644 index e38b0d07a5..0000000000 --- a/xen/arch/ia64/patch/linux-2.6.11/wait.h +++ /dev/null @@ -1,35 +0,0 @@ - wait.h | 6 ++++++ - 1 files changed, 6 insertions(+) - -Index: linux-2.6.11/include/linux/wait.h -=================================================================== ---- linux-2.6.11.orig/include/linux/wait.h 2005-03-02 01:38:10.000000000 -0600 -+++ linux-2.6.11/include/linux/wait.h 2005-03-19 15:00:23.691156973 -0600 -@@ -136,7 +136,11 @@ static inline void __remove_wait_queue(w - list_del(&old->task_list); - } - -+#ifdef XEN -+void FASTCALL(__wake_up(struct task_struct *p)); -+#else - void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key)); -+#endif - extern void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int mode)); - extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr)); - void FASTCALL(__wake_up_bit(wait_queue_head_t *, void *, int)); -@@ -147,6 +151,7 @@ int FASTCALL(out_of_line_wait_on_bit(voi - int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned)); - wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int)); - -+#ifndef XEN - #define wake_up(x) __wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1, NULL) - #define wake_up_nr(x, nr) __wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr, NULL) - #define wake_up_all(x) __wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0, NULL) -@@ -155,6 +160,7 @@ wait_queue_head_t *FASTCALL(bit_waitqueu - #define wake_up_interruptible_all(x) __wake_up(x, TASK_INTERRUPTIBLE, 0, NULL) - #define wake_up_locked(x) __wake_up_locked((x), TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE) - #define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE, 1) -+#endif - - #define __wait_event(wq, condition) \ - do { \ diff --git a/xen/arch/ia64/tools/mkbuildtree b/xen/arch/ia64/tools/mkbuildtree index e181c1cd19..6655fe7b06 100644 --- a/xen/arch/ia64/tools/mkbuildtree +++ b/xen/arch/ia64/tools/mkbuildtree @@ -90,7 +90,8 @@ cp_patch arch/ia64/kernel/ivt.S arch/ia64/ivt.S ivt.S cp_patch arch/ia64/kernel/setup.c arch/ia64/setup.c setup.c cp_patch arch/ia64/kernel/time.c arch/ia64/time.c time.c cp_patch arch/ia64/kernel/unaligned.c arch/ia64/unaligned.c unaligned.c -cp_patch arch/ia64/kernel/vmlinux.lds.S arch/ia64/xen.lds.S lds.S +#cp_patch arch/ia64/kernel/vmlinux.lds.S arch/ia64/xen.lds.S lds.S +softlink arch/ia64/kernel/vmlinux.lds.S arch/ia64/xen.lds.S #cp_patch mm/bootmem.c arch/ia64/mm_bootmem.c mm_bootmem.c #cp_patch mm/page_alloc.c arch/ia64/page_alloc.c page_alloc.c @@ -304,7 +305,6 @@ softlink include/linux/thread_info.h include/asm-ia64/linux/thread_info.h softlink include/linux/threads.h include/asm-ia64/linux/threads.h softlink include/linux/timex.h include/asm-ia64/linux/timex.h softlink include/linux/topology.h include/asm-ia64/linux/topology.h -softlink include/linux/tty.h include/asm-ia64/linux/tty.h softlink include/linux/seqlock.h include/asm-ia64/linux/seqlock.h null include/asm-ia64/linux/file.h @@ -315,6 +315,8 @@ null include/asm-ia64/linux/proc_fs.h null include/asm-ia64/linux/rtc.h null include/asm-ia64/linux/profile.h null include/asm-ia64/linux/seqlock.h +null include/asm-ia64/linux/smp_lock.h +null include/asm-ia64/linux/tty.h softlink include/linux/byteorder/generic.h include/asm-ia64/linux/byteorder/generic.h softlink include/linux/byteorder/little_endian.h include/asm-ia64/linux/byteorder/little_endian.h diff --git a/xen/arch/ia64/xenmem.c b/xen/arch/ia64/xenmem.c new file mode 100644 index 0000000000..c3f255fd51 --- /dev/null +++ b/xen/arch/ia64/xenmem.c @@ -0,0 +1,67 @@ +/* + * Xen memory allocator routines + * + * Copyright (C) 2005 Hewlett-Packard Co + * Dan Magenheimer + * Copyright (C) 2005 Intel Corp. + * + * Routines used by ia64 machines with contiguous (or virtually contiguous) + * memory. + */ + +#include +#include + +extern struct page *zero_page_memmap_ptr; +struct pfn_info *frame_table; +unsigned long frame_table_size; +unsigned long max_page; + +struct page *mem_map; +#define MAX_DMA_ADDRESS ~0UL // FIXME??? + +#ifdef CONFIG_VIRTUAL_MEM_MAP +static unsigned long num_dma_physpages; +#endif + +/* + * Set up the page tables. + */ + +void +paging_init (void) +{ + struct pfn_info *pg; + /* Allocate and map the machine-to-phys table */ + if ((pg = alloc_domheap_pages(NULL, 10)) == NULL) + panic("Not enough memory to bootstrap Xen.\n"); + memset(page_to_virt(pg), 0x55, 16UL << 20); + + /* Other mapping setup */ + + zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); +} + +/* FIXME: postpone support to machines with big holes between physical memorys. + * Current hack allows only efi memdesc upto 4G place. (See efi.c) + */ +#ifndef CONFIG_VIRTUAL_MEM_MAP +#define FT_ALIGN_SIZE (16UL << 20) +void __init init_frametable(void) +{ + unsigned long i, p; + frame_table_size = max_page * sizeof(struct pfn_info); + frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK; + + /* Request continuous trunk from boot allocator, since HV + * address is identity mapped */ + p = alloc_boot_pages(frame_table_size, FT_ALIGN_SIZE); + if (p == 0) + panic("Not enough memory for frame table.\n"); + + frame_table = __va(p); + memset(frame_table, 0, frame_table_size); + printk("size of frame_table: %lukB\n", + frame_table_size >> 10); +} +#endif diff --git a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c index eb8e810491..aac3bf8dd8 100644 --- a/xen/arch/ia64/xenmisc.c +++ b/xen/arch/ia64/xenmisc.c @@ -258,6 +258,40 @@ void sys_exit(void) dummy(); } +//////////////////////////////////// +// called from unaligned.c +//////////////////////////////////// + +void die_if_kernel(char *str, struct pt_regs *regs, long err) /* __attribute__ ((noreturn)) */ +{ + printk("die_if_kernel: called, not implemented\n"); +} + +long +ia64_peek (struct task_struct *child, struct switch_stack *child_stack, + unsigned long user_rbs_end, unsigned long addr, long *val) +{ + printk("ia64_peek: called, not implemented\n"); +} + +long +ia64_poke (struct task_struct *child, struct switch_stack *child_stack, + unsigned long user_rbs_end, unsigned long addr, long val) +{ + printk("ia64_poke: called, not implemented\n"); +} + +void +ia64_sync_fph (struct task_struct *task) +{ + printk("ia64_sync_fph: called, not implemented\n"); +} + +void +ia64_flush_fph (struct task_struct *task) +{ + printk("ia64_flush_fph: called, not implemented\n"); +} //////////////////////////////////// // called from irq_ia64.c:init_IRQ() -- 2.30.2